/*
 * @Description: 内存
 * @Author: rendc
 * @Date: 2023-11-18 08:25:30
 * @LastEditors: rendc
 * @LastEditTime: 2023-11-18 09:01:06
 */
public class Test{
  public static void main(String[] args){
    // 定义一个变量a
    int a = 10; // 10
    int b = a;  // 10
    System.out.println("a: " + a);
    System.out.println("b: " + b);
    a = 20; // 20
    System.out.println("a: " + a); // 20
    System.out.println("b: " + b); // 10
    int[] arr = new int[2];
    arr[0] = 1;
    arr[1] = 2;
    System.out.println("arr[0]: " + arr[0]); // 1
    System.out.println("arr[1]: " + arr[1]); // 2
    // arr：[1,2]
    // arr2：[1,2]
    int[] arr2 = arr;
    System.out.println("arr2[0]: " + arr2[0]); // 1
    System.out.println("arr2[1]: " + arr2[1]); // 2 
    arr2[0] = 12;
    arr2[1] = 22;
    System.out.println("arr[0]: " + arr[0]); // 12
    System.out.println("arr[1]: " + arr[1]); // 22
    System.out.println("arr2[0]: " + arr2[0]); // 12
    System.out.println("arr2[1]: " + arr2[1]); // 22
    System.out.println("arr: " + arr); // [I@7852e922
    System.out.println("arr2: " + arr2); // [I@7852e92
    // 数组异常
    // System.out.println("arr2[3]: " + arr2[3]); 
    // arr2 = [I@7852e92;
    arr2 = null;
    System.out.println("arr2[3]: " + arr2[3]); 
  }
}